﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MemberInfoEdit.aspx.cs" Inherits="WebSystem.Member.MemberInfoEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>个性资料修改</title>
    <link href="../css/StyleforBase.css" type="text/css" rel="stylesheet" />
    <link href="../css/font.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
    
    
//确认用户真实姓名
function chktxtRealName(obj)
{
     var strrealname=obj.value;
     document.getElementById( "errspan1forrealname" ).className = "";
	
	changerealnamePrompt("&nbsp;");
	if( strrealname == "" || strrealname == null ){
	document.getElementById("txtRealName").style.borderColor='red';
		changerealnamePrompt( document.getElementById( "errspan1forrealname" ).innerHTML);
		document.getElementById("errspan1forrealname").className='error';
		return false;
	}
	return true;
  
}
function changerealnamePrompt(strforrealname)
{
    document.getElementById( "divMessageforrealname" ).style.display="";
	document.getElementById( "failinfoforrealname" ).innerHTML = strforrealname;
}


//确认用户电子邮箱
function chktxtEmail(obj)
{
     var stremail=obj.value;
     document.getElementById( "errspan1foremail" ).className = "";
	
	changeemailPrompt("&nbsp;");
	if( stremail == "" || stremail == null ){
	document.getElementById("txtEmail").style.borderColor='red';
		changeemailPrompt( document.getElementById( "errspan1foremail" ).innerHTML);
		document.getElementById("errspan1foremail").className='error';
		return false;
	}
	
	
	if( ! isAlt_email( stremail ) ) {
		changeemailPrompt("常用邮箱格式错误");
		
		return false;
	}
	
	return true;
  
}
//邮箱格式
function isAlt_email( alt_email ){
    //return ( /^[^@]+@[^@]+\.[^@]+$/.test( alt_email ) && alt_email.length<128 );
	return (  /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test( alt_email ) && alt_email.length>=8 && alt_email.length<=64);
}
//输出邮箱提示错误
function changeemailPrompt(strforemail)
{
    document.getElementById( "divMessageforemail" ).style.display="";
	document.getElementById( "failinfoforemail" ).innerHTML = strforemail;
}

//校验固定电话号码
function chktxttel(objforistel)
{ 
    //var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/; 

    document.getElementById( "errspan1fortel" ).className = "";

	changeistelPrompt("&nbsp;");

    var strforistel=objforistel.value;
//    var patrnfortel=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
    var patrnfortel=/(\d){3,4}-(\d){7,8}(-(\d){1,4}){0,1}/;

    if( strforistel == "" || strforistel == null )
    {
	
		
	}
	else
	{
	    if (!patrnfortel.exec(strforistel))
	    {
	    
	    document.getElementById("txtTel").style.borderColor='red';
		changeistelPrompt( document.getElementById( "errspan1fortel" ).innerHTML);
		document.getElementById("errspan1fortel").className='error';
	        return false;
	    }
	}
     
      return true;
} 
//输出固定电话校验结果
function changeistelPrompt(strforistel)
{
    document.getElementById( "divMessagefortel" ).style.display="";
	document.getElementById( "failinfofortel" ).innerHTML = strforistel;
}

//校验手机号码
function chktxtmobile(objforismobile)
{ 
    //var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/; 

    document.getElementById( "errspan1formobile" ).className = "";

	changeismobilePrompt("&nbsp;");

    var strforismobile=objforismobile.value;
    var patrnformobile=/1[3,5,8]\d{9}/;


    if( strforismobile == "" || strforismobile == null )
    {
	
		
	}
	else
	{
	    if (!patrnformobile.exec(strforismobile))
	    {
	    
	        document.getElementById("txtMobile").style.borderColor='red';
		    changeismobilePrompt( document.getElementById( "errspan1formobile" ).innerHTML);
		    document.getElementById("errspan1formobile").className='error';
	        return false;
	    }
	}
     
    return true;
} 
//输出手机校验结果
function changeismobilePrompt(strforismobile)
{
    document.getElementById( "divMessageformobile" ).style.display="";
	document.getElementById( "failinfoformobile" ).innerHTML = strforismobile;
}

//校验QQ号码
function chktxtqq(objforisqq)
{ 
    //var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/; 

    document.getElementById( "errspan1forqq" ).className = "";

	changeisqqPrompt("&nbsp;");

    var strforisqq=objforisqq.value;
    var patrnforqq=/^[0-9]{1,20}$/;





    if( strforisqq == "" || strforisqq == null )
    {
	
		
	}
	else
	{
	    if (!patrnforqq.exec(strforisqq))
	    {
	    
	        document.getElementById("txtqq").style.borderColor='red';
		    changeisqqPrompt( document.getElementById( "errspan1forqq" ).innerHTML);
		    document.getElementById("errspan1forqq").className='error';
	        return false;
	    }
	}
     
    return true;
} 
//输出qq校验结果
function changeisqqPrompt(strforisqq)
{
    document.getElementById( "divMessageforqq" ).style.display="";
	document.getElementById( "failinfoforqq" ).innerHTML = strforisqq;
}




//校验身份证号码
function chktxtcode(objforiscode)
{ 
    //var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/; 

    document.getElementById( "errspan1forcode" ).className = "";

	changeiscodePrompt("&nbsp;");

    var strforiscode=objforiscode.value;
    var patrnforcode=/^[0-9]{1,18}$/;





    if( strforiscode == "" || strforiscode == null )
    {
	
		
	}
	else
	{
	    if (!patrnforcode.exec(strforiscode)||fLen(strforiscode)<15||fLen(strforiscode)>18)
	    {
	    
	        document.getElementById("txtcode").style.borderColor='red';
		    changeiscodePrompt( document.getElementById( "errspan1forcode" ).innerHTML);
		    document.getElementById("errspan1forcode").className='error';
	        return false;
	    }
	}
     
    return true;
} 
//输出身份证校验结果
function changeiscodePrompt(strforiscode)
{
    document.getElementById( "divMessageforcode" ).style.display="";
	document.getElementById( "failinfoforcode" ).innerHTML = strforiscode;
}


function fLen(Obj){
  var nCNLenth = 0;
  var nLenth = Obj.length;
  for (var i=0; i<nLenth; i++){
    if(Obj.charCodeAt(i)>255){
      nCNLenth += 2; 
    }else{
      nCNLenth++;
    }
  }
  return nCNLenth;
}


//终验
function zongcheck()
{
    
    var zongcheckforall=true;
   

    zongcheckforall=chktxtEmail(document.getElementById("txtEmail"));
    
     if(!zongcheckforall)
    {
        return zongcheckforall;
    }
    
    
    zongcheckforall=chktxtRealName(document.getElementById("txtRealName"));
    
     if(!zongcheckforall)
    {
        return zongcheckforall;
    }
    
    zongcheckforall=chktxttel(document.getElementById("txtTel"));
    
     if(!zongcheckforall)
    {
        return zongcheckforall;
    }
    
    zongcheckforall=chktxtmobile(document.getElementById("txtMobile"));
    
     if(!zongcheckforall)
    {
        return zongcheckforall;
    }
    
    zongcheckforall=chktxtqq(document.getElementById("txtqq"));
    
     if(!zongcheckforall)
    {
        return zongcheckforall;
    }
    
    zongcheckforall=chktxtcode(document.getElementById("txtcode"));
    
     if(!zongcheckforall)
    {
        return zongcheckforall;
    }
    

}



</script>

    
</head>
<body style="margin:0px; background-color:#ffffff;">
    <form id="form1" runat="server">
         <table cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td height="10px">
                </td>
            </tr>
            <tr>
                <td height="20px" align="left">
<%--                <font style="color: #426F98; font-family: 宋体; font-weight: bold;font-size: 14px;">个性资料修改</font>
--%>                <img src="../Images/imgs/icon4.gif" /> <span class="dark_blue_bold14">资料修改</span></td>
            </tr>
            <tr>
                <td height="10px">
                </td>
            </tr>
         </table>
         <table cellpadding="0" cellspacing="0" border="0" width="800px">
            <!--会员登录名，不可以修改-->
            <tr>
                <td class="leftforregister">
                    会员名：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtMemberNameforregiester" runat="server" Width="184px" MaxLength="20"  ReadOnly=true></asp:TextBox>
                </td>
                <td class="rightforregister">
                    
                </td>
            </tr>
             <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div style="display:none">
                    <span></span>
                                   
                    </div>
                </td>
            </tr>
            <!--电子邮箱-->
            <tr>
                <td class="leftforregister">
                    电子邮箱：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtEmail" runat="server" Width="184px" MaxLength="64" onfocus="this.style.borderColor='#000000'"  onblur="this.style.borderColor='#A3BFA8';chktxtEmail(this);"></asp:TextBox>
                </td>
                <td class="rightforregister">
                    <span id="errspan1foremail">请填写电子邮箱。</span><br />
                </td>
             </tr>
             <!--电子邮箱检测结果-->
            <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessageforemail" style="display:none">
                    <span id="failinfoforemail"></span>
                                   
                    </div>
                </td>
            </tr>
          </table>
         <!--会员注册详细资料-->
          <table cellpadding="0" cellspacing="0" border="0" width="800px">
            <!--真实姓名-->
           <tr>
                <td class="leftforregister">
                    真实姓名：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtRealName" runat="server" Width="184px" MaxLength="20" onfocus="this.style.borderColor='#000000'"  onblur="this.style.borderColor='#A3BFA8';chktxtRealName(this);"></asp:TextBox>
                </td>
                <td class="rightforregister">
                    <span id="errspan1forrealname">请填写真实姓名。</span><br />
                </td>
             </tr>
             <!--真实姓名检测结果-->
            <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessageforrealname" style="display:none">
                    <span id="failinfoforrealname"></span>
                                   
                    </div>
                </td>
            </tr>
            
            
             <!--性别-->
            <tr>
                <td class="leftforregister">
                    性别：
                </td>
                <td class="centerforregister">
                  <asp:RadioButton ID="rbtnman" runat="server" GroupName="sex" Checked="True"/>&nbsp;&nbsp;&nbsp;&nbsp;男&nbsp;&nbsp;&nbsp;&nbsp;
                  <asp:RadioButton ID="rbtnwoman" runat="server" GroupName="sex" />&nbsp;&nbsp;&nbsp;&nbsp;女
                    
                </td>
                <td class="rightforregister">
                    <span id="errspan1forsex">请选择性别。</span><br />
                </td>
             </tr>
             <!--性别检测结果，暂无需校验-->
            <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessageforsex" style="display:none">
                    <span id="failinfoforsex"></span>
                                   
                    </div>
                </td>
            </tr>
            
            
            
            <!--会员工作单位-->
            <tr>
                <td class="leftforregister">
                    工作单位：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtUnit" runat="server" Width="184px" MaxLength="250" onfocus="this.style.borderColor='#000000'"  onblur="this.style.borderColor='#A3BFA8';"></asp:TextBox>
                </td>
                <td class="rightforregister">
                    <!--<span id="errspan1forunit">请填写您的工作单位。</span><br />-->
                </td>
             </tr>
             <!--工作单位检测结果，暂无需校验-->
            <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessageforunit" style="display:none">
                    <span id="failinfoforunit"></span>
                                   
                    </div>
                </td>
            </tr>
            
            
           <!--会员地址-->
            <tr>
                <td class="leftforregister">
                    地址：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtAddress" runat="server" Width="184px" MaxLength="250" onfocus="this.style.borderColor='#000000'"  onblur="this.style.borderColor='#A3BFA8';"></asp:TextBox>
                </td>
                <td class="rightforregister">
                    <!--<span id="errspan1foraddress">请填写您的地址。</span><br />-->
                </td>
             </tr>
             <!--会员地址检测结果，暂无需校验-->
             <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessageforaddress" style="display:none">
                    <span id="failinfoforaddress"></span>
                                   
                    </div>
                </td>
            </tr>
            
            
           <!--会员固定电话-->
            <tr>
                <td class="leftforregister">
                    固定电话：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtTel" runat="server" Width="184px" MaxLength="12" onfocus="this.style.borderColor='#000000'"  onblur="this.style.borderColor='#A3BFA8';chktxttel(this);"></asp:TextBox>
                </td>
                <td class="rightforregister">
                    <span id="errspan1fortel">请正确填写固定电话格式。如：0771-3888888</span><br />
                </td>
             </tr>
             <!--固定电话检测结果-->
             <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessagefortel" style="display:none">
                    <span id="failinfofortel"></span>
                                   
                    </div>
                </td>
            </tr>
            
            
           <!--会员手机-->
            <tr>
                <td class="leftforregister">
                    手机号码：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtMobile" runat="server" Width="184px" MaxLength="11" onfocus="this.style.borderColor='#000000'"  onblur="this.style.borderColor='#A3BFA8';chktxtmobile(this);"></asp:TextBox>
                </td>
                <td class="rightforregister">
                    <span id="errspan1formobile">请正确填写手机格式。如：13888888888</span><br />
                </td>
             </tr>
             <!--固定电话检测结果-->
             <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessageformobile" style="display:none">
                    <span id="failinfoformobile"></span>
                                   
                    </div>
                </td>
            </tr>
            
            
            
            
            <!--会员QQ号码-->
            <tr>
                <td class="leftforregister">
                    QQ号码：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtqq" runat="server" Width="184px" MaxLength="20" onfocus="this.style.borderColor='#000000'"  onblur="this.style.borderColor='#A3BFA8';chktxtqq(this);"></asp:TextBox>
                </td>
                <td class="rightforregister">
                    <span id="errspan1forqq">请正确填写QQ格式。如：888888888</span><br />
                </td>
             </tr>
             <!--QQ号码检测结果-->
             <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessageforqq" style="display:none">
                    <span id="failinfoforqq"></span>
                                   
                    </div>
                </td>
            </tr>
            
            
            
            <!--会员身份证号码-->
            <tr >
                <td class="leftforregister">
                    身份证号码：
                </td>
                <td class="centerforregister">
                    <asp:TextBox ID="txtcode" runat="server" Width="184px" MaxLength="18" onfocus="this.style.borderColor='#000000'"  onblur="this.style.borderColor='#A3BFA8';chktxtcode(this);"></asp:TextBox>
                </td>
                <td class="rightforregister">
                    <span id="errspan1forcode">请正确填写身份证格式。如：450103198808088888</span><br />
                </td>
            </tr>
            <!--身份证号码检测结果-->
             <tr height="20px">
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                    <div  id="divMessageforcode" style="display:none">
                    <span id="failinfoforcode"></span>
                                   
                    </div>
                </td>
            </tr>
            
            
            
            <%--按钮提交--%>
             <tr>
                <td class="leftforregister">
                    
                </td>
                <td class="jyjgforregister" colspan="2">
                 
                    <asp:ImageButton ID="ibtnedit" runat="server" ImageUrl="../Images/Basic/xiugai.gif"
                         ToolTip="修改" OnClientClick="javascript:return zongcheck();" OnClick="ibtnedit_Click"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:ImageButton ID="ibtnback" runat="server" ImageUrl="../Images/Basic/fanhui.gif"
                         ToolTip="返回" OnClick="ibtnback_Click" Visible="false"/>
                                   

                </td>
            </tr>
            
         </table>    
    </form>
</body>
</html>
